package cn.iocoder.yudao.module.pay.splitting.mq;

import cn.hutool.extra.spring.SpringUtil;
import cn.iocoder.yudao.module.api.pay.splitting.message.SplittingRequestMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 分账 事件生产者
 *
 * @author 山野羡民（1032694760@qq.com）
 */
@Slf4j
@Component
public class SplittingProducer {

    public void sendSplittingRequestMessage(String payNo, Long amount) {
        log.info("[sendSplittingRequestMessage][payNo({}), amount({})]", payNo, amount);
        SpringUtil.getApplicationContext().publishEvent(new SplittingRequestMessage(payNo, amount));
    }

}
